<template>
  <div class="tag-group">
    <el-tag
      :type="tag.type || types[~~(Math.random() * 5)]"
      closable
      :key="tag.key"
      v-for="tag in tagList"
      @close="$emit('update:tagList', tag)"
    >
      {{ tag.label }}:{{ tag.value }}
    </el-tag>
  </div>
</template>

<script>
export default {
  name: "TagGroup",
  props: {
    tagList: Array, // 数据格式：[{label:'最高价',key:'maxPrice',value:999,type:'success'},{}]
  },
  data() {
    return {
      types: ["success", "danger", "info", "primary", "warning"],
    };
  },
};
</script>

<style scoped></style>
